#!/usr/bin/env python
# -*-coding:utf-8-*-
import platform
'''
提供一些和系统平台有关的方法，比如检查是否是linux系统、替换字符串里系统禁用的字符
'''


def isWindowsSystem():
    return 'Windows' in platform.system()


def isLinuxSystem():
    return 'Linux' in platform.system()


def getSystemName():
    return platform.system()


# 替换windows系统下文件名里的禁用字符
def replaceDisabledCharInWindows(fileNameText):
    if isWindowsSystem():
        fileNameText = fileNameText.replace("?", "？")
        fileNameText = fileNameText.replace("\\", "")
        fileNameText = fileNameText.replace("/", "")
        fileNameText = fileNameText.replace(":", "：")
        fileNameText = fileNameText.replace("\"", "")
        fileNameText = fileNameText.replace("<", "")
        fileNameText = fileNameText.replace(">", "")
        fileNameText = fileNameText.replace("|", "")
    return fileNameText
